<template>
    <div class="app-container" style="padding: 5px;">
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span style="font-weight: bold;color: #0099ff;font-size: 16px;">抽检售后工单统计</span>
            </div>
            <el-table :data="xsshorders" border stripe height="500">
                <el-table-column label="日期" align="center" prop="wk_year" width="240" fixed></el-table-column>
                <el-table-column label="翠珠" align="center" prop="zz">
                    <template slot-scope="scope">
                        <span v-if="scope.row.zz=='0'"></span>
                        <span v-if="scope.row.zz!='0'" style="color:red;">{{ scope.row.zz }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="蓝盆花" align="center" prop="lbh">
                    <template slot-scope="scope">
                        <span v-if="scope.row.lbh=='0'"></span>
                        <span v-if="scope.row.lbh!='0'" style="color:red;">{{ scope.row.lbh }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="虞美人" align="center" prop="ymr">
                    <template slot-scope="scope">
                        <span v-if="scope.row.ymr=='0'"></span>
                        <span v-if="scope.row.ymr!='0'" style="color:red;">{{ scope.row.ymr }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="风铃草" align="center" prop="flc">
                    <template slot-scope="scope">
                        <span v-if="scope.row.flc=='0'"></span>
                        <span v-if="scope.row.flc!='0'" style="color:red;">{{ scope.row.flc }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="风铃" align="center" prop="fl">
                    <template slot-scope="scope">
                        <span v-if="scope.row.fl=='0'"></span>
                        <span v-if="scope.row.fl!='0'" style="color:red;">{{ scope.row.fl }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="黄金球" align="center" prop="hjq">
                    <template slot-scope="scope">
                        <span v-if="scope.row.hjq=='0'"></span>
                        <span v-if="scope.row.hjq!='0'" style="color:red;">{{ scope.row.hjq }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="蓝星花" align="center" prop="lxh">
                    <template slot-scope="scope">
                        <span v-if="scope.row.lxh=='0'"></span>
                        <span v-if="scope.row.lxh!='0'" style="color:red;">{{ scope.row.lxh }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="大飞燕" align="center" prop="dfy">
                    <template slot-scope="scope">
                        <span v-if="scope.row.dfy=='0'"></span>
                        <span v-if="scope.row.dfy!='0'" style="color:red;">{{ scope.row.dfy }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="翠菊" align="center" prop="zj">
                    <template slot-scope="scope">
                        <span v-if="scope.row.zj=='0'"></span>
                        <span v-if="scope.row.zj!='0'" style="color:red;">{{ scope.row.zj }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="黑种草" align="center" prop="hzc">
                    <template slot-scope="scope">
                        <span v-if="scope.row.hzc=='0'"></span>
                        <span v-if="scope.row.hzc!='0'" style="color:red;">{{ scope.row.hzc }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="蓝刺头" align="center" prop="lct">
                    <template slot-scope="scope">
                        <span v-if="scope.row.lct=='0'"></span>
                        <span v-if="scope.row.lct!='0'" style="color:red;">{{ scope.row.lct }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="银羽" align="center" prop="yy">
                    <template slot-scope="scope">
                        <span v-if="scope.row.yy=='0'"></span>
                        <span v-if="scope.row.yy!='0'" style="color:red;">{{ scope.row.yy }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="小飞燕" align="center" prop="xfy">
                    <template slot-scope="scope">
                        <span v-if="scope.row.xfy=='0'"></span>
                        <span v-if="scope.row.xfy!='0'" style="color:red;">{{ scope.row.xfy }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="喷泉草" align="center" prop="pqc">
                    <template slot-scope="scope">
                        <span v-if="scope.row.pqc=='0'"></span>
                        <span v-if="scope.row.pqc!='0'" style="color:red;">{{ scope.row.pqc }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="蓝星花-圆瓣白玉" align="center" prop="ybby">
                    <template slot-scope="scope">
                        <span v-if="scope.row.ybby=='0'"></span>
                        <span v-if="scope.row.ybby!='0'" style="color:red;">{{ scope.row.ybby }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="千鸟飞燕" align="center" prop="qnfy">
                    <template slot-scope="scope">
                        <span v-if="scope.row.qnfy=='0'"></span>
                        <span v-if="scope.row.qnfy!='0'" style="color:red;">{{ scope.row.qnfy }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="绿毛球" align="center" prop="lmq">
                    <template slot-scope="scope">
                        <span v-if="scope.row.lmq=='0'"></span>
                        <span v-if="scope.row.lmq!='0'" style="color:red;">{{ scope.row.lmq }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="松虫草" align="center" prop="scc">
                    <template slot-scope="scope">
                        <span v-if="scope.row.scc=='0'"></span>
                        <span v-if="scope.row.scc!='0'" style="color:red;">{{ scope.row.scc }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="总和" align="center" prop="zh">
                    <template slot-scope="scope">
                        <span v-if="scope.row.zh=='0'"></span>
                        <span v-if="scope.row.zh!='0'" style="color:red;">{{ scope.row.zh }}</span>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>

        <el-card class="box-card" style="margin-top: 5px;">
            <div slot="header" class="clearfix">
                <span style="font-weight: bold;color: #0099ff;font-size: 16px;">抽检售后工单明细</span>
            </div>
            <el-table v-loading="loading" :data="xsshordersInfo" border stripe>
                <el-table-column label="日期" align="center" prop="wk_year" width="240"></el-table-column>
                <el-table-column label="种苗品类" align="center" prop="zmpl"></el-table-column>
                <el-table-column label="所属客户" align="center" prop="sskh"/>
                <el-table-column label="所属销售" align="center" prop="ssxs"/>
                <el-table-column label="抽检反馈" align="left" prop="cjfk" width="400"/>
                <el-table-column label="根系不好" align="center" prop="gxbh">
                    <template slot-scope="scope">
                        <span v-if="scope.row.gxbh=='0'"></span>
                        <span v-if="scope.row.gxbh=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
                <el-table-column label="难拔起来" align="center" prop="nbql">
                    <template slot-scope="scope">
                        <span v-if="scope.row.nbql=='0'"></span>
                        <span v-if="scope.row.nbql=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
                <el-table-column label="黄叶" align="center" prop="hy">
                    <template slot-scope="scope">
                        <span v-if="scope.row.hy=='0'"></span>
                        <span v-if="scope.row.hy=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
                <el-table-column label="苗小" align="center" prop="mx">
                    <template slot-scope="scope">
                        <span v-if="scope.row.mx=='0'"></span>
                        <span v-if="scope.row.mx=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
                <el-table-column label="苗大" align="center" prop="md">
                    <template slot-scope="scope">
                        <span v-if="scope.row.md=='0'"></span>
                        <span v-if="scope.row.md=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
                <el-table-column label="土球散" align="center" prop="tqs">
                    <template slot-scope="scope">
                        <span v-if="scope.row.tqs=='0'"></span>
                        <span v-if="scope.row.tqs=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
                <el-table-column label="提货批次多" align="center" prop="thpcd">
                    <template slot-scope="scope">
                        <span v-if="scope.row.thpcd=='0'"></span>
                        <span v-if="scope.row.thpcd=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
                <el-table-column label="其他" align="center" prop="qt">
                    <template slot-scope="scope">
                        <span v-if="scope.row.qt=='0'"></span>
                        <span v-if="scope.row.qt=='1'"><el-button type="info" circle></el-button></span>
                    </template>
                </el-table-column>
            </el-table>
            <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
        </el-card>
    </div>
</template>

<script>
import { listCjshSummary,listCjshOrdersInfo } from "@/api/system/dashboard/shdashboard";
import * as echarts from 'echarts';
export default {
  name: "Cjshdash",
  data() {
    return {
        loading: true,
        total: 0,
        xsshorders: [],
        xsshordersInfo: [],
        queryParams: {
            pageNum: 1,
            pageSize: 10,
        },
    }
  },
  created() {
    this.getCjshSummary();
    this.getList();
  },
  mounted(){
  },
  methods: {
    getCjshSummary(){
        listCjshSummary().then(res =>{
            this.xsshorders = res.data;
        })
    },
    getList(){
        this.loading = true;
        listCjshOrdersInfo(this.queryParams).then(response => {
            this.xsshordersInfo = response.rows;
            this.total = response.total;
            this.loading = false;
        });
    },
  }
};
</script>